package net.xiaoyu233.mitemod.miteite.network;

import net.minecraft.AxisAlignedBB;
import net.minecraft.Connection;
import net.minecraft.Packet;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class PacketParticle extends Packet {
    private int particleType;
    private double posX, posY, posZ;
    private double param1, param2, param3;
    private int BLOCKid;



    private int Entityid;





    public PacketParticle(int type, double x, double y, double z, double p1, double p2, double p3) {
        this.particleType = type;
        this.posX = x;
        this.posY = y;
        this.posZ = z;
        this.param1 = p1;
        this.param2 = p2;
        this.param3 = p3;
    }
    public PacketParticle(int type, double x, double y, double z, int id,int entity){
        this.particleType = type;
        this.posX = x;
        this.posY = y;
        this.posZ = z;
        this.BLOCKid = id;
        this.Entityid = entity;
    }


    @Override
    public void readPacketData(DataInput input) throws IOException {

        this.particleType = input.readInt();
        this.posX = input.readDouble();
        this.posY = input.readDouble();
        this.posZ = input.readDouble();
        this.param1 = input.readDouble();
        this.param2 = input.readDouble();
        this.param3 = input.readDouble();
        this.BLOCKid = input.readInt();
        this.Entityid= input.readInt();
    }

    @Override
    public void writePacketData(DataOutput output) throws IOException {
        output.writeInt(particleType);
        output.writeDouble(posX);
        output.writeDouble(posY);
        output.writeDouble(posZ);
        output.writeDouble(param1);
        output.writeDouble(param2);
        output.writeDouble(param3);
        output.writeInt(BLOCKid);
        output.writeInt(Entityid);


    }

    @Override
    public void processPacket(Connection handler) {

        handler.processPacketParticle(this);

    }

    @Override
    public int getPacketSize() {
        return 64;
    }
    public int getparticleType(){
        return this.particleType;
    }
    public double getPosX() {
        return posX;
    }

    public double getPosY() {
        return posY;
    }

    public double getPosZ() {
        return posZ;
    }

    public double getParam1() {
        return param1;
    }

    public double getParam2() {
        return param2;
    }

    public double getParam3() {
        return param3;
    }
    public int getBLOCKid(){
        return BLOCKid;
    }
    public int getEntityid() {
        return Entityid;
    }


}
